<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bai 2.21</title>
</head>

<body>
<?php
	if(isset($_POST['n']) &&isset($_POST['a']) && isset($_POST['b']))
	{
		$n=$_POST['n'];
		$a=$_POST['a'];
		$b=$_POST['b'];
		$kq="";
		for($i=1;$i<=$n;$i++)
		{
			if($i%$a==0 && $i%$b==0)
				$kq.="$i ";
		}
	}
?>
<form id="form1" name="form1" method="post" action="Bai2_21.php">
  <table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr style="text-align: center; color: #C60; font-weight: bold; font-style: italic; font-size: 24px; font-family: Verdana, Geneva, sans-serif;">
      <td colspan="2" bgcolor="#FF9966">SỐ CHIA HẾT CHO A VÀ B</td>
    </tr>
    <tr>
      <td nowrap="nowrap" bgcolor="#FFCCFF">Nhập N:</td>
      <td nowrap="nowrap" bgcolor="#FFCCFF"><input name="n" type="text" id="n" value="<?php echo $_POST['n'];?>" /></td>
    </tr>
    <tr>
      <td nowrap="nowrap" bgcolor="#FFCCFF">Nhập A:</td>
      <td nowrap="nowrap" bgcolor="#FFCCFF"><input name="a" type="text" id="a" value="<?php echo $_POST['a'];?>" /></td>
    </tr>
    <tr>
      <td nowrap="nowrap" bgcolor="#FFCCFF">Nhập B:</td>
      <td nowrap="nowrap" bgcolor="#FFCCFF"><input name="b" type="text" id="b" value="<?php echo $_POST['b'];?>" /></td>
    </tr>
    <tr style="text-align: center">
      <td colspan="2" nowrap="nowrap" bgcolor="#FFCCFF"><input style="background-color:#FF9" type="submit" name="submit" id="submit" value="Các số &lt;= N chia hết cho A và B" /></td>
    </tr>
    <tr>
      <td colspan="2" nowrap="nowrap" bgcolor="#FFCCFF" style="text-align: center"><input name="kq" type="text" id="kq" style="background-color:#FCC; color:#F00; font-weight:bold" value="<?php echo $kq;?>" /></td>
    </tr>
  </table>
</form>
</body>
</html>